<template>
  <div>
    <!-- 右滑进入 -->
    <transition name="van-slide-right">
      <div v-show="visible_r">
        <van-nav-bar
          title="商家详情"
          left-arrow
          @click-left="$router.push('/goodShoping')"
        />
        <!-- 活动与属性 -->
        <div class="activity">
          <van-cell-group>
            <van-cell title="活动与属性" />
          </van-cell-group>
          <ul>
            <li v-for="val in shoping.activities" :key="val.id">
              <em
                :class="{
                  jian: val.icon_name == '减',
                  te: val.icon_name == '特',
                }"
                >{{ val.icon_name }}</em
              >
              {{ val.description + "（APP专享）" }}
            </li>
            <li v-for="val in shoping.supports" :key="val.id">
              <em
                :class="{
                  bao: val.icon_name == '保',
                  zhun: val.icon_name == '准',
                  piao: val.icon_name == '票',
                }"
                >{{ val.icon_name }}</em
              >
              {{ val.description + "（APP专享）" }}
            </li>
            <li></li>
          </ul>
        </div>
      </div>
    </transition>
  </div>
</template>

<script>
import { goodShoping } from "../api/goodShoping";
export default {
  data() {
    return {
      visible_r: false, //右滑进入
      shopid: this.$route.query.shopid,
      shoping: {}, //请求回来的对象
    };
  },
  mounted() {
    this.visible_r = true;
  },
  created() {
    goodShoping(this.shopid).then((res) => {
      console.log(res);
      this.shoping = res.data;
    });
  },
};
</script>

<style lang="less" scoped>
/deep/.van-nav-bar__content {
  background-color: #3190e8;
  .van-icon-arrow-left,
  .van-nav-bar__title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
  }
}
/deep/.van-cell {
  font-size: 18px;
  margin: 8px 0 1px 0;
}
.activity {
  ul {
    margin-top: 10px;
    padding: 0 15px;
    background-color: #fff;
    li {
      font-size: 12px;
      height: 32px;
      line-height: 32px;
    }
  }
}
.jian {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  color: #fff;
  background-color: red;
  text-align: center;
  border: 1px solid red;
  border-radius: 5px;
}
.te {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  color: #fff;
  background-color: red;
  border: 1px solid red;
  text-align: center;
  border-radius: 5px;
}
.bao {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  color: #fff;
  text-align: center;
  border-radius: 5px;
  background-color: #666;
  border: 1px solid #666;
}
.zhun {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  color: #fff;
  text-align: center;
  border-radius: 5px;
  background-color: skyblue;
  border: 1px solid skyblue;
}
.piao {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  color: #fff;
  text-align: center;
  border-radius: 5px;
  background-color: #666;
  border: 1px solid #666;
}
</style>